home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Disc to the Future 2
/
Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin
/
MAC
/
THINKC
/
4_0
/
UUPC3
/
MAC_SPEC
/
MLIB.C
< prev
next >
Wrap
Text File
|
1989-11-20
|
636b
|
49 lines
/* lib.c
macintosh library
Things to do in uu host
serial I/O
directory stuff
opendir, readdir, closedir
prolog and epilog
system call
*/
#include <stdio.h>
#include "host.h"
#ifndef THINK_C
#include <sgtty.h>
int get_one()
{
char c;
struct sgttyb stty, sttyo;
ioctl( 0, TIOCGETP, &stty );
sttyo = stty;
stty.sg_flags |= CBREAK;
stty.sg_flags &= ~ ECHO;
ioctl( 0, TIOCSETP, &stty );
c = fgetc( stdin );
ioctl( 0, TIOCSETP, &sttyo );
return( c );
}
#else
# include <console.h>
get_one() {
int ch;
csetmode(C_CBREAK, stdin);
ch = getc(stdin);
csetmode(C_ECHO, stdin);
return(ch);
}
#endif